package com.devops.common.utils;

import lombok.Data;

@Data
public class Message {
	private String code;
	
	private String message;
	
	private Object data;

	public static Message ok(Object data){
		return new Message(data);
	}

	public static Message ok(){
		return new Message(null);
	}
	
	public static Message ok(String message,Object data){
		return new Message(message, data);
	}

	public static Message error(Object errorMes){
		return new Message("500",errorMes.toString(),null);
	}

	public Message() {
	}

	public Message(Object data) {
		this.code = "200";
		this.message = "操作成功";
		this.data = data;
	}

	public Message(String message,Object data) {
		this.code = "200";
		this.message = message;
		this.data = data;
	}

	public Message(String code, String message, Object data) {
		this.code = code;
		this.message = message;
		this.data = data;
	}
	
}
